﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../../Content/js/angular1.2.13.js"></script>
</head>
<body ng-app="app">
    <label>Their Url filed;</label>
    <input type="text"  ng-model="theirUrl" />
    <div  my-directive some-attr="theirUrl" my-link-text="Click me to go to Goole" ></div>
    <script>
        angular.module('app', [])
        .directive('myDirective', function () {
            return {
                restrict: 'A',
                replace:true,
                scope: {
                    myUrl: '=someAttr',//经过了修改
                    myLinkText:'@'
                },
                template:' \
                    <div>\
                        <label>My Url Filed:</label>\
                        <input type="text" ng-model="myUrl" />\
                        <a href="{{myUrl}}">{{myLinkText}}</a>\
                    </div>\
                '
            }
        })
    </script>
</body>
</html>
